#include <avr/interrupt.h> 
#include <inttypes.h> 

#define KEY_UP 0 
#define KEY_DOWN 1 
#define KEY_LEFT 2 
#define KEY_RIGHT 3
#define KEY_PUSH 4 
#define KEY_INVALID 5 
#define BUTTON_A 6 // UP 
#define BUTTON_B 7 // DOWN 
#define BUTTON_C 2 // LEFT
#define BUTTON_D 3 // RIGHT 
#define BUTTON_O 4 // PUSH

#define PINB_MASK ((1<<PINB4) | (1<<PINB6) | (1<<PINB7))
#define PINE_MASK ((1<<PINE2) | (1<<PINE3))

#define TRUE 1
#define FALSE 0

#define LONG_PRESS_DURATION 7
#define SHORT_PRESS_DURATION 2



void Enable_Joystick (void);
void PinChangeInterrupt(void);
char getkey(void);


